<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: 'App',
  created() {
    if(!localStorage.getItem('userId')){
      //没有本地记录 生成唯一id
      let userId = this.$util.randomId('tmpUser');
      localStorage.setItem('userId',userId);
    }
    // this.countHuman();
    //访问人数通过userId 如果跟后台对比不超过24小时，自动为一次
    //访问次数每次访问+1
  },
  methods:{
    // countHuman(){
      
    //   let id = localStorage.getItem('userId');
    //   this.$axios.get(this.$url+'countHuman?userId='+id).then(res=>{

    //         let tmp = res.data.data;
    //         console.log(tmp);
    //         this.counntNum();
    //   })
    // },
    countNum(){
      
     
      this.$axios.get(this.$url+'countNum?userId='+id).then(res=>{
    
            let tmp = res.data.data;
            console.log(tmp);
      })
    }
  }
   // watch: {
   //      '$route' () {
   //        let locationHash = window.location.hash;
   //        sessionStorage.setItem("hashLocation",locationHash);//把路由存在缓存中，此处你可以console.log看出路由变化

   //      }
   //    },
}
</script>

<style>
@import url('http://at.alicdn.com/t/font_1593125_4tjqbkt45et.css');
#app{
  overflow: hidden;
  height: 100%;
  background: #E9EAED;
}
.v-show-content{
  white-space: normal;
  padding: 0 !important;
}
.active{
	color: #b7b77c !important;
	background: none !important;
}
.nav-link.active{
	border-color: #dee2e6 #dee2e6 #836a6a !important;
}
</style>
